.class public Les/fl0;
.super Ljava/lang/Object;
.source "DownloadDispatcherImpl.java"

# interfaces
.implements Les/el0;


# static fields
.field private static volatile f:Les/fl0;


# instance fields
.field private final a:Landroid/os/Handler;

.field private final b:Ljava/util/List;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/List<",
            "Les/ik0;",
            ">;"
        }
    .end annotation
.end field

.field private final c:Ljava/util/Map;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/Map<",
            "Ljava/lang/String;",
            "Les/ik0;",
            ">;"
        }
    .end annotation
.end field

.field private final d:Ljava/util/concurrent/CopyOnWriteArrayList;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/concurrent/CopyOnWriteArrayList<",
            "Les/wi0;",
            ">;"
        }
    .end annotation
.end field

.field private e:J


# direct methods
.method static constructor <clinit>()V
    .locals 0

    return-void
.end method

.method private constructor <init>()V
    .locals 2

    .line 1
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 2
    new-instance v0, Ljava/util/concurrent/CopyOnWriteArrayList;

    invoke-direct {v0}, Ljava/util/concurrent/CopyOnWriteArrayList;-><init>()V

    iput-object v0, p0, Les/fl0;->b:Ljava/util/List;

    .line 3
    new-instance v0, Ljava/util/concurrent/ConcurrentHashMap;

    invoke-direct {v0}, Ljava/util/concurrent/ConcurrentHashMap;-><init>()V

    iput-object v0, p0, Les/fl0;->c:Ljava/util/Map;

    .line 4
    new-instance v0, Ljava/util/concurrent/CopyOnWriteArrayList;

    invoke-direct {v0}, Ljava/util/concurrent/CopyOnWriteArrayList;-><init>()V

    iput-object v0, p0, Les/fl0;->d:Ljava/util/concurrent/CopyOnWriteArrayList;

    .line 5
    new-instance v0, Landroid/os/Handler;

    invoke-static {}, Landroid/os/Looper;->getMainLooper()Landroid/os/Looper;

    move-result-object v1

    invoke-direct {v0, v1}, Landroid/os/Handler;-><init>(Landroid/os/Looper;)V

    iput-object v0, p0, Les/fl0;->a:Landroid/os/Handler;

    return-void
.end method

.method public static a()Les/fl0;
    .locals 2

    .line 2
    sget-object v0, Les/fl0;->f:Les/fl0;

    if-nez v0, :cond_1

    .line 3
    const-class v0, Les/fl0;

    monitor-enter v0

    .line 4
    :try_start_0
    sget-object v1, Les/fl0;->f:Les/fl0;

    if-nez v1, :cond_0

    .line 5
    new-instance v1, Les/fl0;

    invoke-direct {v1}, Les/fl0;-><init>()V

    sput-object v1, Les/fl0;->f:Les/fl0;

    .line 6
    :cond_0
    monitor-exit v0

    goto :goto_0

    :catchall_0
    move-exception v1

    monitor-exit v0
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    throw v1

    .line 7
    :cond_1
    :goto_0
    sget-object v0, Les/fl0;->f:Les/fl0;

    return-object v0
.end method

.method static synthetic a(Les/fl0;)Ljava/util/concurrent/CopyOnWriteArrayList;
    .locals 0

    .line 1
    iget-object p0, p0, Les/fl0;->d:Ljava/util/concurrent/CopyOnWriteArrayList;

    return-object p0
.end method

.method private b()V
    .locals 7

    .line 10
    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v0

    .line 11
    iget-wide v2, p0, Les/fl0;->e:J

    sub-long v2, v0, v2

    const-wide/32 v4, 0x1d4c0

    cmp-long v6, v2, v4

    if-gez v6, :cond_0

    return-void

    .line 12
    :cond_0
    iput-wide v0, p0, Les/fl0;->e:J

    .line 13
    iget-object v0, p0, Les/fl0;->b:Ljava/util/List;

    invoke-interface {v0}, Ljava/util/List;->isEmpty()Z

    move-result v0

    if-nez v0, :cond_1

    .line 14
    invoke-direct {p0}, Les/fl0;->c()V

    :cond_1
    return-void
.end method

.method private declared-synchronized b(Landroid/content/Context;ILes/aj0;Les/zi0;)V
    .locals 2

    monitor-enter p0

    .line 1
    :try_start_0
    iget-object v0, p0, Les/fl0;->b:Ljava/util/List;

    invoke-interface {v0}, Ljava/util/List;->size()I

    move-result v0

    if-gtz v0, :cond_0

    .line 2
    invoke-direct {p0, p1, p2, p3, p4}, Les/fl0;->c(Landroid/content/Context;ILes/aj0;Les/zi0;)V

    goto :goto_0

    .line 3
    :cond_0
    iget-object v0, p0, Les/fl0;->b:Ljava/util/List;

    const/4 v1, 0x0

    invoke-interface {v0, v1}, Ljava/util/List;->remove(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Les/ik0;

    .line 4
    invoke-interface {v0, p1}, Les/ik0;->a(Landroid/content/Context;)Les/ik0;

    move-result-object p1

    .line 5
    invoke-interface {p1, p2, p3}, Les/ik0;->a(ILes/aj0;)Les/ik0;

    move-result-object p1

    .line 6
    invoke-interface {p1, p4}, Les/ik0;->a(Les/zi0;)Les/ik0;

    move-result-object p1

    .line 7
    invoke-interface {p1}, Les/ik0;->a()V

    .line 8
    iget-object p1, p0, Les/fl0;->c:Ljava/util/Map;

    invoke-interface {p4}, Les/zi0;->a()Ljava/lang/String;

    move-result-object p2

    invoke-interface {p1, p2, v0}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    .line 9
    :goto_0
    monitor-exit p0

    return-void

    :catchall_0
    move-exception p1

    monitor-exit p0

    throw p1
.end method

.method private c()V
    .locals 10

    .line 7
    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v0

    .line 8
    new-instance v2, Ljava/util/ArrayList;

    invoke-direct {v2}, Ljava/util/ArrayList;-><init>()V

    .line 9
    iget-object v3, p0, Les/fl0;->b:Ljava/util/List;

    invoke-interface {v3}, Ljava/util/List;->iterator()Ljava/util/Iterator;

    move-result-object v3

    :cond_0
    :goto_0
    invoke-interface {v3}, Ljava/util/Iterator;->hasNext()Z

    move-result v4

    if-eqz v4, :cond_2

    invoke-interface {v3}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v4

    check-cast v4, Les/ik0;

    .line 10
    invoke-interface {v4}, Les/ik0;->b()Z

    move-result v5

    if-eqz v5, :cond_1

    goto :goto_0

    .line 11
    :cond_1
    invoke-interface {v4}, Les/ik0;->d()J

    move-result-wide v5

    sub-long v5, v0, v5

    const-wide/32 v7, 0x1d4c0

    cmp-long v9, v5, v7

    if-lez v9, :cond_0

    .line 12
    invoke-interface {v4}, Les/ik0;->g()V

    .line 13
    invoke-interface {v2, v4}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    goto :goto_0

    .line 14
    :cond_2
    invoke-interface {v2}, Ljava/util/List;->isEmpty()Z

    move-result v0

    if-nez v0, :cond_3

    .line 15
    iget-object v0, p0, Les/fl0;->b:Ljava/util/List;

    invoke-interface {v0, v2}, Ljava/util/List;->removeAll(Ljava/util/Collection;)Z

    :cond_3
    return-void
.end method

.method private c(Landroid/content/Context;ILes/aj0;Les/zi0;)V
    .locals 1

    if-nez p4, :cond_0

    return-void

    .line 1
    :cond_0
    new-instance v0, Les/hk0;

    invoke-direct {v0}, Les/hk0;-><init>()V

    .line 2
    invoke-interface {v0, p1}, Les/ik0;->a(Landroid/content/Context;)Les/ik0;

    move-result-object p1

    .line 3
    invoke-interface {p1, p2, p3}, Les/ik0;->a(ILes/aj0;)Les/ik0;

    move-result-object p1

    .line 4
    invoke-interface {p1, p4}, Les/ik0;->a(Les/zi0;)Les/ik0;

    move-result-object p1

    .line 5
    invoke-interface {p1}, Les/ik0;->a()V

    .line 6
    iget-object p1, p0, Les/fl0;->c:Ljava/util/Map;

    invoke-interface {p4}, Les/zi0;->a()Ljava/lang/String;

    move-result-object p2

    invoke-interface {p1, p2, v0}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    return-void
.end method


# virtual methods
.method public a(Ljava/lang/String;)Les/hk0;
    .locals 2

    .line 14
    iget-object v0, p0, Les/fl0;->c:Ljava/util/Map;

    const/4 v1, 0x0

    if-eqz v0, :cond_1

    invoke-interface {v0}, Ljava/util/Map;->size()I

    move-result v0

    if-eqz v0, :cond_1

    invoke-static {p1}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v0

    if-eqz v0, :cond_0

    goto :goto_0

    .line 15
    :cond_0
    iget-object v0, p0, Les/fl0;->c:Ljava/util/Map;

    invoke-interface {v0, p1}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object p1

    check-cast p1, Les/ik0;

    .line 16
    instance-of v0, p1, Les/hk0;

    if-eqz v0, :cond_1

    .line 17
    check-cast p1, Les/hk0;

    return-object p1

    :cond_1
    :goto_0
    return-object v1
.end method

.method public a(Landroid/content/Context;ILes/aj0;Les/zi0;)V
    .locals 2

    if-eqz p4, :cond_3

    .line 8
    invoke-interface {p4}, Les/zi0;->a()Ljava/lang/String;

    move-result-object v0

    invoke-static {v0}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v0

    if-eqz v0, :cond_0

    goto :goto_0

    .line 9
    :cond_0
    iget-object v0, p0, Les/fl0;->c:Ljava/util/Map;

    invoke-interface {p4}, Les/zi0;->a()Ljava/lang/String;

    move-result-object v1

    invoke-interface {v0, v1}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Les/ik0;

    if-eqz v0, :cond_1

    .line 10
    invoke-interface {v0, p1}, Les/ik0;->a(Landroid/content/Context;)Les/ik0;

    move-result-object p1

    invoke-interface {p1, p2, p3}, Les/ik0;->a(ILes/aj0;)Les/ik0;

    move-result-object p1

    invoke-interface {p1, p4}, Les/ik0;->a(Les/zi0;)Les/ik0;

    move-result-object p1

    invoke-interface {p1}, Les/ik0;->a()V

    return-void

    .line 11
    :cond_1
    iget-object v0, p0, Les/fl0;->b:Ljava/util/List;

    invoke-interface {v0}, Ljava/util/List;->isEmpty()Z

    move-result v0

    if-nez v0, :cond_2

    .line 12
    invoke-direct {p0, p1, p2, p3, p4}, Les/fl0;->b(Landroid/content/Context;ILes/aj0;Les/zi0;)V

    goto :goto_0

    .line 13
    :cond_2
    invoke-direct {p0, p1, p2, p3, p4}, Les/fl0;->c(Landroid/content/Context;ILes/aj0;Les/zi0;)V

    :cond_3
    :goto_0
    return-void
.end method

.method public a(Les/wi0;)V
    .locals 1

    if-eqz p1, :cond_0

    .line 31
    iget-object v0, p0, Les/fl0;->d:Ljava/util/concurrent/CopyOnWriteArrayList;

    invoke-virtual {v0, p1}, Ljava/util/concurrent/CopyOnWriteArrayList;->add(Ljava/lang/Object;)Z

    :cond_0
    return-void
.end method

.method public a(Les/zi0;Les/xi0;Les/yi0;)V
    .locals 2
    .param p2    # Les/xi0;
        .annotation build Landroidx/annotation/Nullable;
        .end annotation
    .end param
    .param p3    # Les/yi0;
        .annotation build Landroidx/annotation/Nullable;
        .end annotation
    .end param

    .line 32
    iget-object v0, p0, Les/fl0;->a:Landroid/os/Handler;

    new-instance v1, Les/fl0$a;

    invoke-direct {v1, p0, p1, p2, p3}, Les/fl0$a;-><init>(Les/fl0;Les/zi0;Les/xi0;Les/yi0;)V

    invoke-virtual {v0, v1}, Landroid/os/Handler;->post(Ljava/lang/Runnable;)Z

    return-void
.end method

.method public a(Les/zn0;)V
    .locals 2

    .line 35
    iget-object v0, p0, Les/fl0;->a:Landroid/os/Handler;

    new-instance v1, Les/fl0$e;

    invoke-direct {v1, p0, p1}, Les/fl0$e;-><init>(Les/fl0;Les/zn0;)V

    invoke-virtual {v0, v1}, Landroid/os/Handler;->post(Ljava/lang/Runnable;)Z

    return-void
.end method

.method public a(Les/zn0;Lcom/ss/android/socialbase/downloader/e/a;Ljava/lang/String;)V
    .locals 2

    .line 33
    iget-object v0, p0, Les/fl0;->a:Landroid/os/Handler;

    new-instance v1, Les/fl0$b;

    invoke-direct {v1, p0, p1, p2, p3}, Les/fl0$b;-><init>(Les/fl0;Les/zn0;Lcom/ss/android/socialbase/downloader/e/a;Ljava/lang/String;)V

    invoke-virtual {v0, v1}, Landroid/os/Handler;->post(Ljava/lang/Runnable;)Z

    return-void
.end method

.method public a(Les/zn0;Ljava/lang/String;)V
    .locals 2

    .line 34
    iget-object v0, p0, Les/fl0;->a:Landroid/os/Handler;

    new-instance v1, Les/fl0$c;

    invoke-direct {v1, p0, p1, p2}, Les/fl0$c;-><init>(Les/fl0;Les/zn0;Ljava/lang/String;)V

    invoke-virtual {v0, v1}, Landroid/os/Handler;->post(Ljava/lang/Runnable;)Z

    return-void
.end method

.method public a(Ljava/lang/String;I)V
    .locals 1

    .line 18
    invoke-static {p1}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v0

    if-eqz v0, :cond_0

    return-void

    .line 19
    :cond_0
    iget-object v0, p0, Les/fl0;->c:Ljava/util/Map;

    invoke-interface {v0, p1}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Les/ik0;

    if-eqz v0, :cond_2

    .line 20
    invoke-interface {v0, p2}, Les/ik0;->a(I)Z

    move-result p2

    if-eqz p2, :cond_1

    .line 21
    iget-object p2, p0, Les/fl0;->b:Ljava/util/List;

    invoke-interface {p2, v0}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    .line 22
    iget-object p2, p0, Les/fl0;->c:Ljava/util/Map;

    invoke-interface {p2, p1}, Ljava/util/Map;->remove(Ljava/lang/Object;)Ljava/lang/Object;

    .line 23
    :cond_1
    invoke-direct {p0}, Les/fl0;->b()V

    :cond_2
    return-void
.end method

.method public a(Ljava/lang/String;JI)V
    .locals 7

    const/4 v5, 0x0

    const/4 v6, 0x0

    move-object v0, p0

    move-object v1, p1

    move-wide v2, p2

    move v4, p4

    .line 27
    invoke-virtual/range {v0 .. v6}, Les/fl0;->a(Ljava/lang/String;JILes/yi0;Les/xi0;)V

    return-void
.end method

.method public a(Ljava/lang/String;JILes/yi0;Les/xi0;)V
    .locals 1

    .line 28
    invoke-static {p1}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v0

    if-eqz v0, :cond_0

    return-void

    .line 29
    :cond_0
    iget-object v0, p0, Les/fl0;->c:Ljava/util/Map;

    invoke-interface {v0, p1}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object p1

    check-cast p1, Les/ik0;

    if-eqz p1, :cond_1

    .line 30
    invoke-interface {p1, p5}, Les/ik0;->a(Les/yi0;)Les/ik0;

    move-result-object p1

    invoke-interface {p1, p6}, Les/ik0;->a(Les/xi0;)Les/ik0;

    move-result-object p1

    invoke-interface {p1, p2, p3, p4}, Les/ik0;->a(JI)V

    :cond_1
    return-void
.end method

.method public a(Ljava/lang/String;Z)V
    .locals 1

    .line 24
    invoke-static {p1}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v0

    if-eqz v0, :cond_0

    return-void

    .line 25
    :cond_0
    iget-object v0, p0, Les/fl0;->c:Ljava/util/Map;

    invoke-interface {v0, p1}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object p1

    check-cast p1, Les/ik0;

    if-eqz p1, :cond_1

    .line 26
    invoke-interface {p1, p2}, Les/ik0;->a(Z)V

    :cond_1
    return-void
.end method

.method public b(Les/zn0;Ljava/lang/String;)V
    .locals 2

    .line 15
    iget-object v0, p0, Les/fl0;->a:Landroid/os/Handler;

    new-instance v1, Les/fl0$d;

    invoke-direct {v1, p0, p1, p2}, Les/fl0$d;-><init>(Les/fl0;Les/zn0;Ljava/lang/String;)V

    invoke-virtual {v0, v1}, Landroid/os/Handler;->post(Ljava/lang/Runnable;)Z

    return-void
.end method
